unit frmMainUnit2;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  ExtCtrls;

type

  { TfrmMain }

  TfrmMain = class(TForm)
    btnGo: TButton;
    memLog: TMemo;
    panButtons: TPanel;
    procedure btnGoClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  frmMain: TfrmMain;

implementation

{$R *.lfm}

uses
  ObjectsUnit2;

{ TfrmMain }

procedure TfrmMain.btnGoClick(Sender: TObject);
var
  AppVersion: TExecutableVersionContainer;
  Content: TContentContainer;
  ContentItem: TContentItemContainer;
  JSON: String;
begin
  memLog.Lines.Add('App Version:');
  AppVersion:= TExecutableVersionContainer.Create;
  JSON:= AppVersion.ToJSON;
  memLog.Lines.Add(JSON);
  AppVersion.Free;
  memLog.Lines.Add('Content Versions Empty:');
  Content:= TContentContainer.Create;
  JSON:= Content.ToJSON;
  memLog.Lines.Add(JSON);
  memLog.Lines.Add('Content Versions:');
  ContentItem:= TContentItemContainer.Create;
  ContentItem.ID:= 'news';
  ContentItem.Version:= 1;
  ContentItem.Name:= 'News';
  ContentItem.ContentType:= ctHTML;
  ContentItem.Path:= 'content';
  ContentItem.FileName:= 'news.html';
  Content.Add(ContentItem);
  JSON:= Content.ToJSON;
  memLog.Lines.Add(JSON);
  Content.Free;
end;

end.

